﻿@{
    ViewBag.Title = "Index";
}
@model IEnumerable<Core.DonVi>
<div class="row-fluid">

    <div class="span12">
        <h3>Quản lý Đơn Vị</h3>
        <div class="well">

            <a id="btnDeleteAll"  onserverclick="btnDeleteAll_Click" class="btn btn-danger multidelete">Xóa dòng được chọn</a>
            <a href="#myModal" role="button" class="btn btn-primary" data-toggle="modal">Thêm mới</a>
            <a href="@Url.Action("Index")" class="btn btn-warning"><i class="icon-refresh"></i></a>
            <a class="btn disabled">Hiện đang có @Model.Count() mục trong CSDL.</a>
        </div>
        <table class="table table-striped table-bordered">
            <thead>
                <tr>
                    <th>
                        <input type="checkbox" />
                    </th>
                    <th>#</th>
                    <th>Tên đơn vị</th>
                </tr>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>
                            <input type="checkbox" />
                        </td>
                        <td>
                            @item.ID
                        </td>
                        <td>@item.TenDonVi</td>
                    </tr>
                }
            </thead>

        </table>
            

</div>
</div>

@using (Html.BeginForm("AddNew","DonVi", FormMethod.Post)) { 
<!-- Modal -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
        <h3 id="myModalLabel">Thêm mới tên đơn vị</h3>
    </div>
    <div class="modal-body">
        <label>Tên đơn vị</label>
        <input type="text" name="TenDonVi" id="TenDonVi" class="input input-xlarge" placeholder="Tên đơn vị" required="" />
      
    </div>
    <div class="modal-footer">
        <button class="btn" data-dismiss="modal" aria-hidden="true">Hủy</button>
        <button class="btn btn-primary" type="submit" >Lưu</button>
    </div>
</div>
}
